home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 4331 < prev    next >
Encoding:
Text File  |  1996-08-06  |  1.3 KB  |  42 lines

  1. Path: howland.reston.ans.net!agate!parsons
  2. From: parsons@vouvray.CS.Berkeley.EDU (David C. Parsons)
  3. Newsgroups: comp.lang.c++
  4. Subject: Newbie question on syntax of pointer to const
  5. Date: 29 Jan 1996 20:07:44 GMT
  6. Organization: University of California, Berkeley
  7. Message-ID: <4ej9eg$lq6@agate.berkeley.edu>
  8. NNTP-Posting-Host: vouvray.cs.berkeley.edu
  9.  
  10. In a declaration of a const reference or const pointer type, does it matter
  11. in what the order the keyword const and the underlying type appear?  That
  12. is, are
  13.  
  14. (1)    const double *pc;    and
  15. (2)    double const *pc;
  16.  
  17. both acceptable syntax for type "pointer to constant double"?  (My book only
  18. describes (1), but my compiler accepts either.)
  19.  
  20. The reason I ask is because I'm getting the following error from the linker:
  21.  
  22. /bin/ld: Unsatisfied symbols:
  23.    operator<<(ostream &, Matrix<double> const &)(code)
  24.    Matrix<double>::Matrix(Matrix<double> const &)(code)
  25.  
  26. even though I have definitions like these:
  27.  
  28.     template <class Type>
  29.     ostream& operator <<( ostream& os, const Matrix<Type>& m )
  30.     {    ...    }
  31.  
  32.     template <class Type>
  33.     Matrix<Type>::Matrix( const Matrix<Type> &m )
  34.     {    ...    }
  35.  
  36. Are the function prototypes in the error message different from these in
  37. some way I'm overlooking?
  38.  
  39. Many thanks in advance.
  40.  
  41. David Parsons
  42.